Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: interpretations modal height (DHIS2-15558) #1549

Closed

Conversation

martinkrulltott
Copy link
Contributor

@martinkrulltott martinkrulltott commented Jul 6, 2023

Implements DHIS2-15558

Relates to https://github.com/dhis2/data-visualizer-app/pull/XXX


Key features

  1. Set interpretations modal height to max height of viewport
  2. Change scroll behaviour to only affect messages

Description

Previously the interpretations modal didn't have a min height, so the modal could become unusably short. This was especially problematic in DV, as visualisations there adapt to the height of the container (modal). This fix sets the height to the max available height in the viewport.

In addition this fix also addresses a weird scroll behaviour where the top and bottom the interpretations modal would scroll as well. The top and bottom are now fixed and only the list of messages scroll instead.


Known issues

  • Console error when closing
  • Visualization flashes / loads multiple times - DHIS2-15570

Screenshots

before vs after

interpretations.modal.mov

before: height

image

after: height

image

before: scroll

image

after: scroll

image

@martinkrulltott martinkrulltott removed their assignment Jul 7, 2023
Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a big UI issue, but I believe it does create a much smaller issue as well. Currently if we would show a table with a small height in the interpretations modal, the modal would not contain much whitespace. Since we now have a height of calc(100vw - 128px), there will be whitespace whenever the table has limited height.

On balance I'd say that the implementation in this PR is better than what we have: looking at some whitespace is a lot less of a problem than looking at a badly squashed graph. So I am approving.

But I am also wondering if perhaps it would be a good idea to have a prop which would allow us to switch between the auto-height and fixed-height implementation, since for tables auto-height is better, while for graphs the fixed height is required.

@@ -24,21 +24,22 @@ const modalCSS = css.resolve`
max-width: calc(100vw - 128px) !important;
max-height: calc(100vh - 128px) !important;
width: auto !important;
height: auto !important;
height: calc(100vw - 128px) !important;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
height: calc(100vw - 128px) !important;
height: calc(100vh - 128px) !important;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup 👍

@martinkrulltott
Copy link
Contributor Author

martinkrulltott commented Oct 23, 2023

Superseded by the combo PR #1588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants